package com.iris.live.services.data.repositories;

import com.iris.live.services.data.models.销售顾问状态Model;
import com.iris.live.services.data.models.销售顾问状态ModelPK;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import java.util.Date;

public interface 销售顾问状态Repository extends JpaRepository<销售顾问状态Model, 销售顾问状态ModelPK>, JpaSpecificationExecutor<销售顾问状态Model>{
    @Modifying
    @Query("delete from 销售顾问状态Model u where u.许可=?1 and u.日期=?2")
    int deleteSaleStatusByPermitAndDate(String permit,Date date);
    
    @Modifying
    @Query("update 销售顾问状态Model u set u.状态码=?1 where u.许可=?2 AND u.日期=?3 AND u.销售顾问=?4 and u.排班顺序=?5 and u.是否当班=?6 ")
    int updateSalePersonStatus(String stateCode, String permit, Date date, String saleGW, int a, String b);
    
    
}
